﻿


using System;
using Demo.Domain;
using System.Data.Entity.ModelConfiguration;
using System.ComponentModel.DataAnnotations.Schema;


namespace Demo.Domain
{
    public class ModuleMapping : EntityTypeConfiguration<Module>
    {
        public ModuleMapping()
        {
            this.HasKey(m => m.ModuleID).Property(m => m.ModuleID).IsRequired().HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);
            this.Property(m => m.Name).HasMaxLength(20).IsRequired();
            this.Property(m => m.Sort).IsRequired();
        }
    }
}
